#!/usr/bin/make -f
export DEB_CFLAGS_SET=
export DEB_LDFLAGS_SET=

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

%:
	dh $@

override_dh_auto_build:
	make --no-print-directory
	VERSION=$$(linux/deploy/version) && \
	sed s/@version@/$$VERSION/g \
	debian/templates/image.preinst.in \
	> debian/firefly-rk3399-dev-kernel-image.preinst
	VERSION=$$(linux/deploy/version) && \
	sed s/@version@/$$VERSION/g \
	debian/templates/image.postinst.in \
	> debian/firefly-rk3399-dev-kernel-image.postinst
	VERSION=$$(linux/deploy/version) && \
	sed s/@version@/$$VERSION/g \
	debian/templates/image.prerm.in \
	> debian/firefly-rk3399-dev-kernel-image.prerm
	VERSION=$$(linux/deploy/version) && \
	sed s/@version@/$$VERSION/g \
	debian/templates/image.postrm.in \
	> debian/firefly-rk3399-dev-kernel-image.postrm

override_dh_auto_install:
	make --no-print-directory install DESTDIR=debian/firefly-rk3399-dev-kernel-image
